package com.ayz.gateway.center.domain.service;


import com.ayz.gateway.center.application.IApiService;
import com.ayz.gateway.center.domain.repository.IApiRepository;
import com.ayz.gateway.common.constants.ApiData;
import com.ayz.gateway.common.constants.ApplicationConfigWrapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName ApiServiceImpl
 * @Description TODO: 网关注册中心服务实现类
 * @Author 快乐的星球
 * @Date 2023/5/13 18:28
 * @Version 1.0
 **/
@Service
public class ApiServiceImpl implements IApiService {
    @Resource(type = IApiRepository.class)
    private IApiRepository apiRepository;

    @Override
    public List<ApiData> queryApiDataList() {
        return apiRepository.getApiDataList();
    }

    @Override
    public void registryApplication(String address, String applicationName, ApplicationConfigWrapper configWrapper, String gatewayGroup) {
        this.apiRepository.registerApplication(address,applicationName,configWrapper,gatewayGroup);
    }
}
